package com.shelpe.services.sinbad.controller.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.shelpe.services.sinbad.entity.jpa.Campaign;
import com.shelpe.services.sinbad.entity.jpa.vo.ConvertPlatformVo;

import lombok.Data;

@Data
public class CampaignItem {
	@JsonProperty("campaign_id")
	private long campaignID;
	@JsonProperty("online_status")
	private String onlineStatus;
	private String name;
	private int budget;
	private ConvertPlatformVo platform;
	@JsonProperty("auto_type")
	private String autoType;
	@JsonProperty("adgroup_num")
	private long adgroupNum;

	public void from(Campaign campaign) {
		this.onlineStatus = campaign.getOnlineStatus().name();
		this.name = campaign.getTitle();
		this.budget = campaign.getBudget();
		this.campaignID = campaign.getAutoID();
		this.autoType = campaign.getAutoType().name();
	}
}
